﻿using Microsoft.EntityFrameworkCore;
using MockSchoolManagement.Models;
using MockSchoolManagement.Models.EnumTypes;

namespace MockSchoolManagement.Infrastructure
{
    public static class ModelBuilderExtensions
    {
        public static void Seed(this ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Student>().HasData(
            new Student
            {
                Id = 1,
                Name = "梁桐铭",
                Major = MajorEnum.ElectronicCommerce,
                Email = "ltm@ddxc.org"
            }
            );
            modelBuilder.Entity<Student>().HasData(
            new Student
            {
                Id = 2,
                Name = "张三",
                Major = MajorEnum.ComputerScience,
                Email = "zhangsan@52abp.com"
                }
                );
                modelBuilder.Entity<Student>().HasData(
                new Student
                {
                    Id = 3,
                    Name = "计算机与科学",
                    Major = MajorEnum.ElectronicCommerce,
                    Email = "lisi@52abp.com"
                }
                );
        }

    }
}
